package com.lh.entity.table;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(value = "ProblemFeedback", description = "问题反馈表实体类")
@TableName("problem_feedback") // 对应数据库表名
public class ProblemFeedback {

    @ApiModelProperty(value = "主键ID")
    @TableId(type = IdType.AUTO) // 主键自增，对应表中 AUTO_INCREMENT
    private Long id;

    @ApiModelProperty(value = "反馈人姓名", required = true)
    @TableField("name") // 对应表字段 name
    private String name;

    @ApiModelProperty(value = "反馈人单位", required = true)
    @TableField("department") // 对应表字段 department
    private String department;

    @ApiModelProperty(value = "反馈人电话（支持固话/手机号）", required = true)
    @TableField("phone") // 对应表字段 phone
    private String phone;

    @ApiModelProperty(value = "反馈事项（如：系统问题、功能建议、数据错误等）", required = true)
    @TableField("feedback_item") // 对应表字段 feedback_item
    private String feedbackItem;

    @ApiModelProperty(value = "反馈内容（详细描述）", required = true)
    @TableField("feedback_content") // 对应表字段 feedback_content
    private String feedbackContent;

    @TableField("feedback_type") // 对应表字段 feedback_url
    private String feedbackType;

    @TableField("feedback_url") // 对应表字段 feedback_url
    private String feedbackUrl;

    @ApiModelProperty(value = "反馈时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "feedback_time") // 插入时自动填充（需配置填充器）
    private Date feedbackTime;

    @ApiModelProperty(value = "处理状态（0-未处理，1-处理中，2-已办结）", example = "0")
    @TableField("handle_status") // 对应表字段 handle_status
    private Integer handleStatus;

    @ApiModelProperty(value = "处理备注（后台填写）")
    @TableField("handle_remark") // 对应表字段 handle_remark
    private String handleRemark;

    @ApiModelProperty(value = "处理完成时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField("handle_time") // 对应表字段 handle_time
    private Date handleTime;
}
